package com.github.andy0106.kersstjtl.api;

import com.github.andy0106.kersstjtl.files.Dir;

import java.nio.file.Path;

public class TargetFile {
    private String name;
    private String target;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public boolean download(String packname, String pack_path) {
        return ApiBuffer.download_file(packname, name, target.replace("${pack}", pack_path));
    }
    public boolean download(String packname, Path pack_path) {
        return download(packname, pack_path.toString());
    }
    public boolean download(String packname, Dir pack_path) {
        return download(packname, pack_path.getPaths().toString());
    }
}
